/* ========================================================================= */
/*              Copyright (C) 2000 Texas Instruments Incorporated.           */
/*                              All Rights Reserved                          */
/* ========================================================================= */
/* The code scales 3 planes of y, Cr, Cb data in varying combinations        */
/* NOTES                                                                     */
/* When the phrase "pixels" is used this measn a color pixel, this has       */
/* a color combination of  4:2:2, 4:4:4 or 4:2:0                             */
/* for 4:4:4 there are 3 identical coloe spaces all the same size            */
/* for 4:2:2 there planes are the same height but only half as wide          */
/* for 4:2:0 the planes are 1/2 the width and 1/2 the height                 */
/*                                                                           */
/* The scaler will automatically filter output data only within the display  */
/* if it is larger than the display it will write to the boundary, if smaller*/
/* it will centre the image in the middle.                                   */
/*                                                                           */
/* This function can be applied to R, G, B data also R->Y, G->Cr, B->Cb      */
/* ========================================================================= */
/*              Copyright (C) 2000 Texas Instruments Incorporated.           */
/*                              All Rights Reserved                          */
/* ========================================================================= */


int scale_2d_ycrcb (
  int     format,           /* 4:4:4 == 2, 4:2:2 == 1, 4:2:0 == 0            */

  int     p_h,              /* numerator for horizontal scale factor p/q     */
  int     q_h,              /* denominator for horizontal scale factor p/q   */

  short * hpatch,           /* stride table for horizontal scaling jumps     */
  short * hh,               /* pntr to horz filter bank                      */
  int     l_hh,             /* number of taps in each horz filter            */
  int     n_hh,             /* number of filters in horz filter bank         */

  int     p_v,              /* numerator for vertical scale factor p/q       */
  int     q_v,              /* denominator for vertical scale factor p/q     */

  short * vpatch,           /* stride table for vertical scaling jumps       */
  short * hv,               /* pntr to vert filter bank                      */
  int     l_hv,             /* number of taps in each vert filter            */
  int     n_hv,             /* number of filters in vert filter bank         */

  int     in_pic_height,    /* height of picture in Pixels multiple of 2     */
  int     in_pic_width,     /* width  of picture in Pixels multiple of 8     */

  int     display_height,   /* height of picture in Pixels multiple of 2     */
  int     display_width,    /* width  of picture in Pixels multiple of 8     */

  unsigned char * image_y,  /* pntr to input image planar y values           */
  unsigned char * image_cr, /* pntr to input image planar cr values          */
  unsigned char * image_cb, /* pntr to input image planar cb values          */
  void  * scratch_pad,      /* temp space for internal buffers and stores    */
                            /* aligned to a double boundary                  */
  unsigned char * image_rgb); /* pntr to output image, scaled in color         */
/* ========================================================================== */
/*               Copyright (C) 2000 Texas Instruments Incorporated.           */
/*                               All Rights Reserved                          */
/* ========================================================================== */
